package com.todo.common.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author zhangwenxiang
 * @date 2023/12/30 15:50
 * @description
 */
@Getter
@AllArgsConstructor
public enum BusinessSceneEnum {

    CITY(1,"CITY", "城市"),
    SIGHT(2,"SIGHT", "景点"),
    CONTENT(3,"CONTENT", "内容"),
    FOOD(4,"FOOD", "美食"),
    PARTNER(5,"PARTNER", "搭子"),
    MARKETING(6,"MARKETING", "营销"),
    PLATFORM_STRATEGY(7,"PLATFORM_STRATEGY", "平台攻略"),
    STRATEGY(8,"STRATEGY", "用户攻略"),
    USER(9,"USER", "用户"),
    TRAVEL_CARD(10,"TRAVEL_CARD", "旅游卡"),
    BIZ_BASE(11,"BIZ_BASE", "基础服务"),
    SYSTEM(12,"SYSTEM", "系统后台"),
    ;

    private static Map<Integer, BusinessSceneEnum> enumMap = Arrays.stream(BusinessSceneEnum.values()).collect(Collectors.toMap(BusinessSceneEnum::getScene, e -> e));
    private static Map<String, BusinessSceneEnum> codeMap = Arrays.stream(BusinessSceneEnum.values()).collect(Collectors.toMap(BusinessSceneEnum::getSceneCode, e -> e));

    private Integer scene;
    /**
     * 场景code
     */
    private String sceneCode;
    /**
     * 场景描述
     */
    private String sceneDesc;


    public static BusinessSceneEnum getBusinessSceneEnumByScene(Integer scene){
        if (scene == null){
            return null;
        }
        return enumMap.get(scene);
    }

    public static BusinessSceneEnum getBusinessSceneEnumByCode(String code){
        if (code == null){
            return null;
        }
        return enumMap.get(code);
    }
}
